<#--
List of variables to be passed for this template:
    - rootPackage
    - applicationName
    - className
    - directory

-->
<@pp.dropOutputFile />
<@pp.changeOutputFile name="/development/${directory}/views/${className}.java" />

package ${rootPackage}.${applicationName}.views;

import com.nanosn.coffeemaker.server.restlet.CoffeeMakerResource;
import freemarker.template.Template;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.restlet.data.MediaType;
import org.restlet.ext.freemarker.TemplateRepresentation;
import org.restlet.resource.Representation;
import org.restlet.resource.ServerResource;

public class ${className} extends ServerResource {

    @Override
    public Representation represent() {

        Template template = null;
        try {
            template = getConfiguration().getTemplate("${className}.html");
        }
        catch (IOException ex) {
            Logger.getLogger(CoffeeMakerResource.class.getName()).log(Level.SEVERE, null, ex);
        }
        Map m = new HashMap();

        TemplateRepresentation templateRepresentation = new TemplateRepresentation(template, m, MediaType.TEXT_HTML);
        return templateRepresentation;
    }
}

